package com.线程;

public class JSTACK简单查看 {


    /**
     * jps 获取java进程
     *
     * jstack + 进程id 获取堆栈信息
     *
     *
     * 模拟 线程 blocked , waiting , time_waiting , runnable
     */
    final  static Object obj  = new Object();
    public static void main(String[] args) throws InterruptedException {


      Thread t =   new Thread(()->{

          synchronized (obj){
            for(;;){


                    System.out.println(Thread.currentThread().getName()+":"+System.currentTimeMillis());


            }}
        },"t1");



          t.start();



        synchronized (obj){
            int i = 0 ;
            while(true) {
                i++;
            }
        }
    }
}
